package com.fit.pianosheetshop.pages;


import java.util.LinkedList;

import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;

import com.fit.pianosheetshop.beans.PianistBean;
import com.fit.pianosheetshop.interfaces.Borrow;
import com.fit.pianosheetshop.interfaces.Pianist;
import com.fit.pianosheetshop.service.Pianists;



public class EntryPianist {
	
	@Property
	@Persist
	private Pianist pianist;

	@Inject
	private Pianists pianists;

	@SetupRender
	public void createObject() {
		pianist = new PianistBean();
		pianist.setBorrow(new LinkedList<Borrow>());
	}

	void onSuccess() {
		pianists.save(pianist);
	}

}
